package com.google.code.guava.reflect.predicate;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

enum QualifiedType{
    ClassType(Class.class),
    MethodType(Method.class),
    FieldType(Field.class),
    ConstructorType(Constructor.class);

    public static QualifiedType forType(final Class<?> targetType){
        for(final QualifiedType type : values()){
            if(type.targetType.equals(targetType)) return type;
        }
        throw new IllegalArgumentException(
            String.format("No enum value found to match target type %s",
                targetType));
    }

    private final Class<?> targetType;

    private QualifiedType(final Class<?> targetType){
        this.targetType = targetType;
    }

}
